from pathlib import Path
from typing import TypedDict
def is_file(path:Path):
    return path.is_file() and path.exists()

def ensure_file(path:Path):
    if not is_file(path):
        raise FileNotFoundError(f"File {path.resolve()} does not exist.")

class ExecutorResult(TypedDict):
    executor_exit_code:int
    report_file:Path
    input_file:Path
    output_file:Path
    error_file:Path

from soj.common.judge import JudgeResultCode

class ExecutionResult(TypedDict):
    exit_code:int
    memory_usage:int
    time_usage:int
    status:JudgeResultCode
